//
//  InformationVM.m
//  WanCaiC8
//
//  Created by tangang on 2018/4/21.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "InformationVM.h"
#import "RankListModel.h"
#import "TGTrendListModel.h"
@implementation InformationVM


/**
 GET /api/Trend/GetTrendList
 */
- (void)getTrendListSuccess:(SuccessBlock)success Fail:(FailBlock)fail{
    
    
    
    [self GET_Field_Url:@"api/Trend/GetTrendList" Params:nil successBlock:^(id returnValue) {
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success(returnValue);
            
        }else{
            NSLog(@"%@",[returnValue objectForKey:@"Desc"]);
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        NSLog(@"%@",errorMessage);
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
    
    
}
/**
 获取最新图库
GET /api/News/GetTuNewsList
 */
- (void)getTuNewsListWithPageIndex:(NSInteger)pageIndex  PageSize:(NSInteger)pageSize Success:(SuccessBlock)success Fail:(FailBlock)fail{
    
    NSDictionary *dic= @{@"pageIndex":[NSNumber numberWithInteger:pageIndex],@"pageSize":[NSNumber numberWithInteger:pageSize]};
    
    [self GET_Field_Url:@"api/News/GetTuNewsList" Params:dic successBlock:^(id returnValue) {
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsModel mj_objectArrayWithKeyValuesArray:[[returnValue objectForKey:@"Data"] objectForKey:@"PageData"]]);
            
        }else{
            NSLog(@"%@",[returnValue objectForKey:@"Desc"]);
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        NSLog(@"%@",errorMessage);
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
    
    
    
    
}



/**
 获取新闻栏目信息
 ///api/News/GetNewsType
 */
- (void)getNewsTypeWithID:(NSString *)newsType Success:(SuccessBlock)success Fail:(FailBlock)fail{
 
    [self GET_Field_Url:@"api/News/GetNewsType" Params:@{@"id": newsType} successBlock:^(id returnValue) {
        
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            
            NSDictionary *dic=[returnValue objectForKey:@"Data"];
            
            success(dic);
            
        }else{
            NSLog(@"%@",[returnValue objectForKey:@"Desc"]);
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        NSLog(@"%@",errorMessage);
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
    
}


/**
 获取大彩种列表 （资讯页面）（20181130    新增）
 GET /api/Common/GetParentLotteryList
 */
- (void)getParentLotteryListSuccess:(SuccessBlock)success Fail:(FailBlock)fail{
    
    
    
    [self GET_Field_Url:@"api/Common/GetParentLotteryList" Params:nil successBlock:^(id returnValue) {
        
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            
            NSArray *arr=[returnValue objectForKey:@"Data"];
            
            success([NewsLottryTypeModel mj_objectArrayWithKeyValuesArray:arr]);
            
        }else{
            NSLog(@"%@",[returnValue objectForKey:@"Desc"]);
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        NSLog(@"%@",errorMessage);
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
    
}

/**
 GET /api/News/GetLastNewsList
 获取最新资讯新闻列表
 */
- (void)getLastNewsListWithLtype:(NSString *)lType Page:(NSInteger)pageIndex  PageSize:(NSInteger)pageSize NotInLtype:(NSInteger)notInLtype Success:(SuccessBlock)success Fail:(FailBlock)fail{
    
    
    //先 按照后台规定 这里重新定义notInLtype非0 且ltype为0可用
    //最后一个参数，默认为空，你请求url可以不用拼这个参数信息
    NSMutableDictionary *dic= @{@"lType":lType,@"pageIndex":[NSNumber numberWithInteger:pageIndex],@"pageSize":[NSNumber numberWithInteger:pageSize]}.mutableCopy;
    
    if ([lType integerValue] == 0 && notInLtype !=0) {
        [dic setObject:[NSNumber numberWithInteger:pageIndex] forKey:@"notInLtype"];
    }

    
    [self GET_Field_Url:@"api/News/GetLastNewsList" Params:dic successBlock:^(id returnValue) {
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsModel mj_objectArrayWithKeyValuesArray:[[returnValue objectForKey:@"Data"] objectForKey:@"PageData"]]);
            
        }else{
            NSLog(@"%@",[returnValue objectForKey:@"Desc"]);
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        NSLog(@"%@",errorMessage);
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
    
}


/***************************/

/**
 * 获取首页通知
 **/
- (void)getSiteSettingSuccess:(SuccessBlock)success Fail:(FailBlock)fail{
    
    
    [self GET_Field_Url:@"api/Common/GetSiteSetting" Params:nil successBlock:^(id returnValue) {
        
        
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            NSDictionary *dic=[returnValue objectForKey:@"Data"];
            
            success(dic);
            
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
        
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}



/**
 * 获取新首页彩种信息列表
 **/
- (void)getNewIndexLotteryListSuccess:(SuccessBlock)success andFail:(FailBlock)fail{
    
  
        [self GET_Field_Url:@"api/Common/GetNewIndexLotteryList" Params:nil successBlock:^(id returnValue) {
            
            if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
                NSArray *arr=[returnValue objectForKey:@"Data"];
                
                NSMutableArray *newArr = [NSMutableArray arrayWithArray:[RankListModel mj_objectArrayWithKeyValuesArray:arr.firstObject]] ;
                success(newArr.copy);
                self.homeDataArr = arr.mutableCopy;
                
            }else{
                [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
                fail(nil,nil);
            }
            
        } failBlock:^(NSString *errorMessage, NSError *error) {
            [SVProgressHUD showErrorWithStatus:errorMessage];
            fail(nil,nil);
        }];
        
  
    
    
}


- (void)getNewsLotteryTypeListWithSuccess:(SuccessBlock)success andFail:(FailBlock)fail{
    WS(weakSelf);
    if (self.lotteryTypeArr.count==0) {
        [self GET_Field_Url:@"api/News/GetNewsLotteryTypeList" Params:nil successBlock:^(id returnValue) {
            if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
                NSArray *arr=[returnValue objectForKey:@"Data"];
                [weakSelf.lotteryTypeArr addObjectsFromArray:[NewsLottryTypeModel mj_objectArrayWithKeyValuesArray:arr]];
                success(weakSelf.lotteryTypeArr);
            }else{
                [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
                fail(nil,nil);
            }
        } failBlock:^(NSString *errorMessage, NSError *error) {
            [SVProgressHUD showErrorWithStatus:errorMessage];
            fail(nil,nil);
        }];
    }else{
        success(self.lotteryTypeArr);
    }
}

- (void)getNewsTypeListWithId:(NSString *)lType Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetNewsTypeList" Params:@{@"lType":lType} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            NSArray *arr=[returnValue objectForKey:@"Data"];
            success([NewsTypeModel mj_objectArrayWithKeyValuesArray:arr]);
           
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getLotteryInfoWithId:(NSString *)lType Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetLotteryInfo" Params:@{@"lType":lType} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([Home_LotteryModel mj_objectWithKeyValues:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getNewsListWithId:(NSString *)lType andPage:(NSInteger)pageIndex Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetNewsList" Params:@{@"newsTypeId":lType,@"pageIndex":[NSNumber numberWithInteger:pageIndex],@"pageSize":defaultPageSize} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsModel mj_objectArrayWithKeyValuesArray:[[returnValue objectForKey:@"Data"] objectForKey:@"PageData"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getNewsListWithId:(NSString *)lType Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetNewsList" Params:@{@"newsTypeId":lType,@"pageIndex":@"1",@"pageSize":@5} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsModel mj_objectArrayWithKeyValuesArray:[[returnValue objectForKey:@"Data"] objectForKey:@"PageData"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getGalleryListWithId:(NSString *)lType andNewsTypeId:(NSString *)newsTypeId Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetGalleryTypeList" Params:@{@"ltype":lType,@"newsTypeId":newsTypeId} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([GalleryModel mj_objectWithKeyValues:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getNewsDetailWithId:(NSString *)ID Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/NewsDetail" Params:@{@"id":ID} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsContentModel mj_objectWithKeyValues:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRecommendNewsListWithId:(NSString *)newsTypeId Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetRecommendNewsList" Params:@{@"newsTypeId":newsTypeId} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([NewsModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getLotteryNavListWithSuccess:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetNavigationByLhc" Params:nil successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([LotteryNavModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRecordListWithId:(NSString *)lType andDate:(NSString *)date andPageIndex:(NSInteger)pageIndex Success:(SuccessBlock)success andFail:(FailBlock)fail{
    NSDictionary *dict=[[NSDictionary alloc]initWithObjectsAndKeys:lType,@"lType",@(pageIndex),@"pageIndex",@10000,@"pageSize",date,@"date", nil];
    [self GET_Field_Url:@"api/Record/GetRecordList" Params:dict successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([LotteryRecordModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRecordDateWithId:(NSString *)lType andSuccess:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/Record/GetQueryDate" Params:@{@"lType":lType} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([TimeModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getGrlleryDetailWithId:(NSString *)Id Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetGalleryList" Params:@{@"id":Id} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([GalleryExtraModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRecommendGrlleryWithId:(NSString *)Id Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetRecommendGalleryList" Params:@{@"id":Id} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([GalleryExtraModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getAdvertWithLocation:(NSString *)location andType:(NSInteger)type Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/Advert/GetAdvertisementList" Params:@{@"location":location,@"type":@(type),@"city":[BaseVM manage].city} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([AdvertisingModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRuleListWithLType:(NSString *)lType andParentId:(NSInteger)ParentId Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/Plan/GetPlayRuleList" Params:@{@"lType":lType,@"ParentId":@(ParentId)} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([PlayRuleModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getSubRuleListWithLType:(NSString *)lType andParentId:(NSInteger)ParentId Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/Plan/GetRuleList" Params:@{@"lType":lType,@"ParentId":@(ParentId)} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([PlayRuleModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getMasterListWithLType:(NSString *)lType andPlayName:(NSString *)playName andPage:(NSInteger)page Success:(SuccessBlock)success andFail:(FailBlock)fail{
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:@{@"lType":lType,@"pageIndex":@(page),@"pageSize":@20,@"type":@1}];
    if (playName !=nil) {
        [params setValue:playName forKey:@"playName"];
    }
    
    [self POST_Field_Url:@"api/Plan/GetSuperList" Params:params successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([ExpertsModel mj_objectArrayWithKeyValuesArray:[[returnValue objectForKey:@"Data"] objectForKey:@"PageData"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (void)getRecommendMasterListWithLType:(NSString *)lType Success:(SuccessBlock)success andFail:(FailBlock)fail{
    [self GET_Field_Url:@"api/News/GetRecommendExpert" Params:@{@"lType":lType} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
            success([ExpertsModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}

- (NSMutableArray *)lotteryTypeArr{
    if (!_lotteryTypeArr) {
        _lotteryTypeArr=[[NSMutableArray alloc]init];
    }
    return _lotteryTypeArr;
}

- (NSMutableArray *)homeDataArr{
    if (!_homeDataArr) {
    
        _homeDataArr=[[NSMutableArray alloc]init];
    }
    return _homeDataArr;
}


static InformationVM *n_manager=nil;
+ (InformationVM *)manage{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        n_manager=[[InformationVM alloc]init];
    });
    return n_manager;
}



//MARK:新增 用于6彩频道首页
/**
 * @param lType 彩种分类Id
 **/
- (void)getPlayInfoWithlType:(NSString *)lType Success:(SuccessBlock)success andFail:(FailBlock)fail{
    
    
    
    [self GET_Field_Url:@"api/Plan/GetPlayInfo" Params:@{@"lType":lType} successBlock:^(id returnValue) {
        if ([[returnValue objectForKey:@"Code"] intValue]==APIResponseStutusSuccess) {
//            success([ExpertsModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
            success(nil);

        success([PlayRuleModel mj_objectArrayWithKeyValuesArray:[returnValue objectForKey:@"Data"]]);
        
    
        }else{
            [SVProgressHUD showErrorWithStatus:[returnValue objectForKey:@"Desc"]];
            fail(nil,nil);
        }
    } failBlock:^(NSString *errorMessage, NSError *error) {
        [SVProgressHUD showErrorWithStatus:errorMessage];
        fail(nil,nil);
    }];
}
@end
